<?php
/**
 *	CRUD Um para Muitos
 */
class PC4_Crud_ComComentarios extends PC4_Crud_Tabelas {
	
	public function __construct($config = null, $definition = null) {
		parent::__construct($config, $definition);
		$tabela = $this->config['name'];
		$this->addTabelas(array(
			$tabela . '_comentarios' => array(
				'pk' => 'pc.id_' . $tabela,
				'fk' => $this->alias . '.id',
				'join' => 'left',
				'campos' => array('total' => 'COUNT(pc.id_posts)')
			)
		));
		$this->addGroup('p.id');
	}
	/*
	public function preparaConsulta($where = null, $order = null, $count = null, $offset = null) {
		$where = $this->decorado->preparaConsulta($where, $order, $count, $offset);
		return $where;
	}*/
	
}